#include "tcpServer.hpp"
#include <iostream>
#include <memory>
using namespace yzc_server;
using namespace std;

// tcp 服务器，启动方式与udp server一样
//./tcpServer + local_port    //我们将本主机的所有ip与端口绑定

static void Usage(string proc)
{
    cout << "\nUsage:\n\t" << proc << " lock_port\n\n";
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t serverport = atoi(argv[1]);

    unique_ptr<TcpServer> tsvr(new TcpServer(serviceIO, serverport));
    tsvr->initServer();
    tsvr->run();
    return 0;
}